
public class Equation 
{
	static int total_equation = 0;
	Converter equation_converter;
	String raw_equation_input;
	int answer;
	int []equation;
	String equation_string;
	int total_integer;
	static int currentindex = 0;
	
	Equation(String raw_input)
	{
		raw_equation_input = raw_input;
		computeAnswer();
		computeEquation();
		equation_converter = new Converter(equation, answer);
	}
	
	void computeAnswer()
	{
		answer = Integer.parseInt(raw_equation_input.substring(0, raw_equation_input.indexOf('=') -1));
	}
	void computeEquation()
	{
		equation_string =  raw_equation_input.substring(  raw_equation_input.indexOf('=')+2   ) ;
		 currentindex = 0;
		
		 getTotalInetger();
		 equation = new int[total_integer];
		 
		 
		 for (int i = 0;currentindex<equation_string.length() && equation_string.charAt(currentindex) !=' ';i++)
		 {
			 equation[i] = getNextAt();
			
		 }
		 	
		
	}
	
	void getTotalInetger()
	{
		currentindex = 0;
		
		 while(currentindex<equation_string.length() && equation_string.charAt(currentindex) !=' ')
		 {
			 getNextAt();
			 total_integer++;
		 }
		   
		 
		 
		 currentindex = 0;
	}
	int  getNextAt()
	{
		
		String temp;
		
		temp = "";
		
		for (; currentindex<equation_string.length() && equation_string.charAt(currentindex) !=' ';currentindex++)
		{
				temp+=equation_string.charAt(currentindex);
			
		}
		
		currentindex++;
		return Integer.parseInt(temp);
		
		
		
	}
	
	void computeSolution()
	{
		equation_converter.findPossibleEquation();
		
	}
	
	void displayPossibleSolution()
	{
		equation_converter.listAllExpression();
	}
	
	
	

}
